package com.example.yuanqin.page.login

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import androidx.activity.compose.setContent
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Scaffold
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.navigation.NavController
import androidx.navigation.Navigation
import androidx.navigation.findNavController
import androidx.navigation.ui.setupWithNavController
import com.example.yuanqin.R
import com.google.android.material.navigation.NavigationView

class LoginActivity : AppCompatActivity() {
    var navView: NavigationView? = null
    var navController: NavController? = null
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_login)
        navView = findViewById(R.id.nav_view)
        navController = findNavController(R.id.nav_host_fragment)
        navView?.setupWithNavController(navController!!)

//        setContent {
//           LoginApp()
//        }
    }

    fun goSignInPage(view: View) {
//        navController?.navigate(R.id.signInFragment)

        Navigation.createNavigateOnClickListener(R.id.signInFragment,null)
    }
    fun goSignUpPage(view: View) {
        navController?.navigate(R.id.action_signInFragment_to_signUpFragment)
//        navController?.navigate(R.id.signUpFragment)

    }
}

//@Composable
//fun LoginApp(){
//
//    MaterialTheme() {
//        Scaffold(modifier = Modifier
//            .fillMaxHeight()
//
//        ) {
//
//        }
//    }
//
//}